package com.example.administrator.readbook.http;

import com.example.administrator.readbook.bean.AutoCompleteBean;
import com.example.administrator.readbook.bean.BookChapterBean;
import com.example.administrator.readbook.bean.BookDetailBean;
import com.example.administrator.readbook.bean.BookSourceBean;
import com.example.administrator.readbook.bean.ChapterListBean;
import com.example.administrator.readbook.bean.RankingBean;
import com.example.administrator.readbook.bean.SearchBookBean;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import retrofit2.http.GET;
import retrofit2.http.Path;
import retrofit2.http.QueryMap;


/**
 * Created by Administrator on 2018/7/2.
 */

public interface ServiceUrl {
    //书籍搜索
    @GET("book/fuzzy-search")
    Observable<SearchBookBean> searchBookData(@QueryMap Map<String, String> params);

    //书籍详情
    @GET("book/{id}")
    Observable<BookDetailBean> getBookDetailData(@Path("id") String id);

    //章节列表
    @GET("toc/{id}")
    Observable<ChapterListBean> getChapterListData(@Path("id") String id, @QueryMap(encoded = true) Map<String, String> params);

    //章节内容
    @GET("chapter/{link}")
    Observable<BookChapterBean> getBookChapter(@Path("link") String link, @QueryMap(encoded = true) Map<String, String> params);

    //书源
    @GET("toc")
    Observable<List<BookSourceBean>> getBookSourceListData(@QueryMap(encoded = true) Map<String, String> params);

    //自动补全
    @GET("book/auto-complete")
    Observable<AutoCompleteBean> getAutoCompleteData(@QueryMap(encoded = true) Map<String, String> params);

    //排行榜
    @GET("ranking/gender")
    Observable<RankingBean> getRankGender();

}
